package com.opages.mvc.adapter.common.condition.annotation;

import com.opages.mvc.adapter.common.condition.OnMissingBeanCondition;
import org.springframework.context.annotation.Conditional;

import java.lang.annotation.*;

/**
 * 根据容器中是否存在指定Class进行注册，如果已存在则不进行注入
 *    由于该注解目前只应用在springMVC上，因此只简单设置.class类判断
 * @author daizhong.liu
 **/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE, ElementType.METHOD })
@Documented
@Conditional(OnMissingBeanCondition.class)
public @interface ConditionalOnMissingBean {
    Class<?>[] value() default {};
}
